<template>
  <div class="context_class">
    <div class="mzsm">
      <marquee>
        <span >
           免责声明：本页仅针对伽拿大 2 8官方平台 用户提供数据测试，仅供参考，严禁以任何形式用于其他非正规平台，请各位网友严格自律，否则风险自负，与本站无关！
        </span>
        </marquee>
    </div>

    <!-- <div class="logo_class" @click="dianjilogo"></div> -->

    
    <div class="logoclass">

      <p class="fontaa"> <span class="jiacu">【嘉年华】</span>南港   复制裙玩法，高低陪率【2.0/2.8】，福利多，秒下F</p>


      <div class="diandian">
             <a href="http://manage.wonprocn.com.cn/" >点击注册</a>
            <a href="http://manage.wonprocn.com.cn/" >点击下载APP</a>
      </div>
      
<p class="zhucexiaz">【独有 猜数字 功能】单驻满50既可免费参与！</p>
    </div>

    <el-menu
      :default-active="activeIndex2"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#324157"
      text-color="#BFCBD9"
      active-text-color="#FFC02D"
    >
      <el-menu-item index="1">加拿大28</el-menu-item>
      <!-- <el-menu-item index="2">极速28</el-menu-item> -->
    </el-menu>

    <div class="big_class_2">
        <div class="xiao_nav">
          <div>
              <img src="../assets/wanfa.png" alt="" class="naozhong_1" />
          </div>
          <a href="http://www.jnh28.com/jnd_introduce.html" class="chaolian">玩法介绍</a>
        </div>
        <div class="xiao_nav">
          <div>
              <img src="../assets/yuce.png" alt="" class="naozhong_1" />
          </div>
          <a href="#miao" @click="jieguoyuce()" class="chaolian">结果预测</a>
        </div>
        <div class="xiao_nav">
          <div>
              <img src="../assets/zoushi.png" alt="" class="naozhong_1" />
          </div>
          <a href="#miao" @click="jieguozoushi()" class="chaolian">结果走势</a>
        </div>
        <div class="xiao_nav">
          <div>
              <img src="../assets/lishi.png" alt="" class="naozhong_1" />
          </div>
          <a href="#miao" @click="lishijieguo()" class="chaolian">历史结果</a>
        </div>
        <div class="xiao_nav">
          <div>
              <img src="../assets/66.jpg" alt="" class="naozhong_1" />
          </div>
          <a href="http://www.jnh28.com/jiqiaoxinde.html" class="chaolian">技巧心得</a>
        </div>
    </div>

    <div class="big_class">
      <div class="big_child_class newnew">
        最新：
        <span class="span_q1">
          {{ qishu }}
        </span>
        期
      </div>
      <div class="big_child_class textcentel">
        <span class="dan122"> {{ nowFirstNum }} </span> 
        <span class="jiajia">&nbsp; +</span>
        <span class="dan122"> {{ nowSecondNum }} </span> 
        <span class="jiajia">&nbsp; +</span>
        <span class="dan122"> {{ nowThreeNum }} </span> 
        <span class="jiajia">&nbsp; =</span>
        <span class="dan1222"> {{ nowTotalNum }} </span>
        &nbsp; &nbsp; &nbsp;
        <span class="xiao">{{ nowIsBigOrSamll }}</span>
        <span class="dan12">{{ nowIsdanOrShuang }}</span>
      </div>
      <div class="big_child_class_aa">
        <div class=" textcentelnaoz" v-if="showResultdf">
          <img src="../assets/naozhong.jpg" alt="" class="naozhong" />
          <span class="ddjg">等待开奖结果</span>
          <img src="../assets/lodoing.gif" alt="" class="naozhongLoading" />
        </div>
        <div class=" textcentel" v-if="!showResultdf">
          下一期：
          <span class="dan">{{ xyqfen }}</span>
          分
          <span class="dan">{{ xyqmiao }}</span>
          秒
        </div>
      </div>
    </div>
    <div>
      <div class="nav_class">
        <div class="nav_signle" @click="say('jieguo')" id="jieguoid">
          <a name="miao"></a>
          <i class="el-icon-data-analysis icon_class"></i>结果
        </div>
        <div class="nav_signle" @click="say('zoushi')" id="zoushiid" >
          <a name="miao"></a>
          <i class="el-icon-date icon_class"></i>走势图
        </div>
        <div class="nav_signle" @click="say('yuce')" id="yuceid">
           <a name="miao"></a>
          <i class="el-icon-pie-chart icon_class"></i>预测
        </div>
      </div>
    </div>
    <div v-if="tabValue === 'jieguo'" class="border_class">
      <el-table
        :data="tableData"
         class="zoushitufongt"
        :row-class-name="tableRowClassName"
      >
        <el-table-column prop="section" label="期号" min-width="33">
        </el-table-column>
        <el-table-column
          prop="openTime"
          label="时间"
          :formatter="formartDate"
          min-width="33"
        >
        </el-table-column>
        <el-table-column
          prop="middleCode"
          :formatter="formartResult"
          min-width="33"
          label="结果"
        >
        </el-table-column>
      </el-table>
    </div>

    <div v-if="tabValue === 'zoushitu'" class="border_class">
      <el-table :data="tableData"  class="zoushitufongt" border> 
        <el-table-column prop="section" label="期号"  min-width="15"> </el-table-column>
        <el-table-column prop="value" :formatter="formartResultNew" label="值"  min-width="5">
        </el-table-column>
        <el-table-column prop="big" label="大" min-width="4">
          <template
            slot-scope="scope"
            v-if="formartResultBig(scope.row.middleCode)"
          >
            <span class="xiaosmalldanaa">大</span>
          </template>
        </el-table-column>
        <el-table-column prop="samall" label="小" min-width="4">
          <template
            slot-scope="scope"
            v-if="!formartResultBig(scope.row.middleCode)"
          >
            <span class="xiaoshuangaa"> 小 </span>
          </template>
        </el-table-column>
        <el-table-column prop="dan" label="单" min-width="4">
          <template
            slot-scope="scope"
            v-if="formartResultDan(scope.row.middleCode)"
          >
            <span class="xiaosmalldanaa"> 单 </span>
          </template>
        </el-table-column>
        <el-table-column prop="shuang" label="双" min-width="4">
          <template
            slot-scope="scope"
            v-if="!formartResultDan(scope.row.middleCode)"
          >
            <span class="xiaoshuangaa">双</span>
          </template>
        </el-table-column>
        <el-table-column prop="bigdan" label="大单" min-width="6">
          <template
            slot-scope="scope"
            v-if="formartResultBigDan(scope.row.middleCode) === 'dadan'"
          >
            <span class="xiaosmalldanaa"> 大单 </span>
          </template>
        </el-table-column>
        <el-table-column prop="bigshuang" label="大双" min-width="6">
          <template
            slot-scope="scope"
            v-if="formartResultBigDan(scope.row.middleCode) === 'dashuang'"
          >
            <span class="xiaoshuangaa"> 大双 </span>
          </template>
        </el-table-column>
        <el-table-column prop="smalldan" label="小单" min-width="6">
          <template
            slot-scope="scope"
            v-if="formartResultBigDan(scope.row.middleCode) === 'xiaodan'"
          >
            <span class="xiaosmalldanaa">小单</span>
          </template>
        </el-table-column>
        <el-table-column prop="smallshuang" label="小双" min-width="6">
          <template
            slot-scope="scope"
            v-if="formartResultBigDan(scope.row.middleCode) === 'xiaoshaung'"
          >
            <span class="xiaoshuangaa"> 小双</span>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <div v-if="tabValue === 'yuce'" >
      <el-table :data="tableDataYc"   class="zoushitufongt" :row-class-name="tableRowClassName">
        <el-table-column prop="section" label="期号" min-width="28"> </el-table-column>
        <el-table-column prop="openTime" :formatter="formartDate" label="时间" min-width="24">
        </el-table-column>
        <el-table-column
          prop="middleCode"
          :formatter="formartResult"
          label="结果"
          min-width="22"
        >
        </el-table-column>
        <el-table-column prop="yuce" :formatter="formartResultYc" label="预测" min-width="16">
        </el-table-column>
        <el-table-column prop="result" label="结果" min-width="10">
          <template slot-scope="scope">
            <i
              class="el-icon-check dui"
              v-if="
                formartResultduiorcuo(
                  scope.row.section,
                  scope.row.middleCode
                ) && scope.row.middleCode != ''
              "
            ></i>
            <i
              class="el-icon-close cuowu"
              v-if="
                !formartResultduiorcuo(
                  scope.row.section,
                  scope.row.middleCode
                ) && scope.row.middleCode != ''
              "
            ></i>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>


<style >

.el-menu-demo{
  margin-top: 2px;
}
.el-table th>.cell {
    display: inline-block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    position: relative;
        padding-left: 0px;
    padding-right: 0px;
    vertical-align: middle;
    width: 100%;
}
.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell {
    padding-left: 0px;
    padding-right: 0px;
}
.el-table td,el-table th{
  padding-top: 9px;
  padding-bottom: 9px;
      padding-left: 0px;
    padding-right: 0px;
}
.zoushitufongt{
  width: 150%;

}
.border_class {
  box-shadow: 0 0 6px #909399;
}
.mzsm{
  color: red;
  font-size: 6px;
}
.dui {
  color: green;
  font-weight: 500;
  font-size: 30px;
}
.cuowu {
  color: red;
  font-weight: 500;
  font-size: 30px;
}
.tableclass {
  font-size: 6px;
}
.xiaosmalldanaa {
  display: block;
  text-align: center;
  border-radius: 2px;
  background-color: #96cb3b;
  color: white;
}
.xiaoshuangaa {
  display: block;
  text-align: center;
  border-radius: 2px;
  background-color: #ff831f;
  color: white;
}
.icon_class {
  font-size: 20px;
  line-height: 40px;
}
.nav_signle_first {
  text-align: center;
  color: #f2f6fc;
  /* width: 33.3%; */
  height: 100%;
  background-color: #00c7f7;
  float: left;
}
.nav_signle {
  flex: 1 1 33.33%;
  text-align: center;
  color: #f2f6fc;
  /* width: 33.3%; */
  height: 100%;
  background-color: #335397;
  float: left;
}
.nav_class {
  width: 100%;
  height: 40px;
  display: flex;
  margin-top: 15px;
  justify-content: center;
  box-shadow: 0 0 6px #909399;
}
.dengdaijieguo_class {
  display: inline-block;
  line-height: 50px;
}
.textcentelnaoz{
  padding-top: 10px;
}
.button_flex {
  height: 40px;
  width: 40px;
  background: linear-gradient(70deg, #f2f6fc, #c0c4cc);
  display: inline-block;
}
.textcentel {
  text-align: center;
  line-height: 60px;
  font-size: 15px;
}
.span_q1 {
  color: red;
}
.newnew {
  text-align: center;
  line-height: 60px;
  color: #303133;
  font-size: 15px;
}
.clearfix:after {
  content: "020";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.logo_class {
  width: 100%;
  height: 150px;
  /* background: url(https://ossxiaotian.oss-cn-beijing.aliyuncs.com/jnh28GameImages162641639751945.png) center center no-repeat; */
  background: url("../assets/logo28.png") center center no-repeat;
 background-size: 100% 100%;
  background-repeat: no-repeat;  
}

.clearfix:after{/*伪元素是行内元素 正常浏览器清除浮动方法*/
    content: "";
    display: block;
    height: 0;
    clear:both;
    visibility: hidden;
}
.clearfix{
    *zoom: 1;/*ie6清除浮动的方式 *号只有IE6-IE7执行，其他浏览器不执行*/
}
.big_class_2 {
  width: 100%;
  height: 80px;
  box-shadow: 0 0 6px #909399;
}
.big_class {
  width: 100%;
  height: 180px;
  box-shadow: 0 0 6px #909399;
}
.big_child_class {
  float: left;
  width: 100%;
  height: 33%;
  border-bottom: 1px solid #F2F6FC;
}
.big_child_class_aa{
    float: left;
    width: 100%;
    height: 33%;
}
.xiao {
  background-color: #96cb3b;
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: 18px;
}
.naozhong{
  width: 30px;
  height: 30px;
}
.naozhong_1{
  width: 50px;
  height: 50px;
}
.ddjg{
  font-size: 12px;
  margin-left: 15px;
}
.naozhongLoading{
  margin-left: 15px;
    width: 15px;
  height: 15px;
}
.dan {
  background-color: #ff831f;
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  width: 10%;
}
.el-table td, .el-table th {
    text-align: center;
} 
.dan1222 {
   background-color: #ff831f;
  color: white;
  text-align: center;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 5px;
  padding-right: 5px;
  border-radius: 5px;
  width: 10%;
}
.dan122{
  background-color: #E4E7ED;
  color: #ff831f;
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  width: 10%;
}
.jiajia{
  color: #606266;
}
.dan12{
  background-color: #ff831f;
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: 18px;
  width: 10%;
}
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
.xiao_nav{
  width: 19%;
  height: 100%;
  float: left;
  padding-top: 2px;
}
.chaolian{
    font-size: 12px;
    color: #0a1cbe;
  }

.logoclass{
  width: 100%;
  height: 180px;
  text-align: center;
}
.fontaa{
  color: red;
  margin-top: 10px;
}
.jiacu{
  font-weight: 500;
  line-height: 30px;
}
.diandian{
  color: #8F8F94;
  margin-top: 20px;
}
.zhucexiaz{
  margin-top: 40px;
   color: red;
}

@media screen and (min-width: 900px){

  .logoclass{
  width: 100%;
  height: 180px;
  text-align: center;
}
.fontaa{
  color: red;
  margin-top: 5px;
}
.jiacu{
  font-weight: 500;
  line-height: 20px;
}
.diandian{
  color: #8F8F94;
  margin-top: 30px;
}
.zhucexiaz{
  margin-top: 40px;
   color: red;
}

  .naozhong_1{
  width: 50px;
  height: 50px;
}
  .chaolian{
    font-size: 12px;
    color: #0a1cbe;
  }
  .xiao_nav{
    width: 19%;
    height: 100%;
    float: left;
    padding-top: 2px;
  }
  .big_class_2 {
  width: 100%;
  margin-top: 5px;
  height: 80px;
  box-shadow: 0 0 3px #909399;
}
  .logo_class {
    width: 100%;
    height: 400px;
    background: url(../assets/logo28.png) center center no-repeat;
    background-size: 100% 100%;
    background-repeat: no-repeat;  
  }
  .big_child_class {
    float: left;
    width: 33%;
    height: 100%;
    border-right: 2px solid #F2F6FC;
  }
  .big_child_class_aa{
      float: left;
      width: 33%;
      height: 100%;
  }
  .big_class {
    width: 100%;
    height: 60px;
    margin-top: 5px;
    box-shadow: 0 0 6px #909399;
  }
  .mzsm{
    font-size: 10px;
  }
}
</style>

<script>
import axios from "axios";

export default {
  data() {
    return {
      count: 864000,
      seconds: 150,
      openTime: "",
      tabValue: "jieguo",
      xyqfen: 1,
      xyqmiao: 50,
      showResultdf: false,
      activeIndex: "1",
      activeIndex2: "1",
      qishu: 8595,
      nextQishu: "",
      nowFirstNum: 2,
      nowSecondNum: 2,
      nowThreeNum: 2,
      nowTotalNum: 6,
      nowIsBigOrSamll: "小",
      nowIsdanOrShuang: "单",
      tabvalue: "userCount",
      tableData: [],
      tableDataYc: [],
      tableDataZoushitu: [
        {
          section: "78474545",
          value: "12",
          big: "大",
          samall: "小",
          dan: "单",
          shuang: "双",
          bigdan: "大单",
          bigshuang: "大双",
          smalldan: "小单",
          smallshuang: "小双",
        },
      ],
      tableDataYvce: [
        {
          section: 12121212,
          openTime: "546546546",
          jieguo: 12,
          yuce: "小+单",
          result: false,
        },
      ],
    };
  },
  computed: {},
  methods: {
    dianjilogo(){
      // window.location.href="http://adfg.mnhmrk.cyou/qr.php?room=1&agent=oskKV5vseq4_LRVxGE_xjo5Hf5Yw"
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex %4 === 0) {
        return "warning-row";
      } else if (rowIndex%4 === 2) {
        return "success-row";
      }
      return "";
    },
    lishijieguo(){
      document.getElementById("jieguoid").style.background = "#00C7F7";
      document.getElementById("zoushiid").style.background = "#335397";
      document.getElementById("yuceid").style.background = "#335397";
       this.tabValue = "jieguo";
    },
    jieguozoushi(){
      document.getElementById("jieguoid").style.background = "#335397";
      document.getElementById("zoushiid").style.background = "#00C7F7";
      document.getElementById("yuceid").style.background = "#335397";
       this.tabValue = "zoushitu";
    },
    jieguoyuce() {
      document.getElementById("jieguoid").style.background = "#335397";
      document.getElementById("zoushiid").style.background = "#335397";
      this.tabValue = "yuce";
      document.getElementById("yuceid").style.background = "#00C7F7";
    },
    say(e) {
      document.getElementById("jieguoid").style.background = "#335397";
      document.getElementById("zoushiid").style.background = "#335397";
      document.getElementById("yuceid").style.background = "#335397";

      if (e === "jieguo") {
        this.tabValue = "jieguo";
        document.getElementById("jieguoid").style.background = "#00C7F7";
      }
      if (e === "zoushi") {
        this.tabValue = "zoushitu";
        document.getElementById("zoushiid").style.background = "#00C7F7";
      }
      if (e === "yuce") {
        this.tabValue = "yuce";
        document.getElementById("yuceid").style.background = "#00C7F7";
      }
    },
    clickdiv() {
      
    },
    handleSelect(key, keyPath) {
      this.say("jieguo");

      this.activeIndex2 = key;
      if (key === "1") {
        // 加拿大28
        axios({
          method: "post",
          url: "getInfo/Latest",
          data: {
            type: "jnd28",
          },
        }).then((res) => {
          this.qishu = res.data.section;
          var openNums = res.data.openNums;
          let as = openNums.split(",");
          this.nowFirstNum = as[0];
          this.nowSecondNum = as[1];
          this.nowThreeNum = as[2];
          this.nowTotalNum =
            parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
          if (this.nowTotalNum > 13) {
            this.nowIsBigOrSamll = "大";
          } else {
            this.nowIsBigOrSamll = "小";
          }
          if (this.nowTotalNum % 2 == 0) {
            this.nowIsdanOrShuang = "双";
          } else {
            this.nowIsdanOrShuang = "单";
          }
        });
        axios({
          method: "post",
          url: "getInfo/MyOpens",
          data: {
            type: "jnd28",
          },
        }).then((res) => {
          this.tableData = res.data.data;
          axios({
            method: "post",
            url: "getInfo/Next",
            data: {
              type: "jnd28",
            },
          }).then((res) => {
            // 计算 开奖倒计时
            var timediff = res.data.openTime - res.data.serverTime;
            this.seconds = timediff / 1000;
            this.nextQishu = res.data.section;

            let nextYc = {
              section: this.nextQishu,
              isOpen: "",
              middleCode: "",
              openTime: "",
            };
            this.tableDataYc = JSON.parse(JSON.stringify(this.tableData));
            this.tableDataYc.unshift(nextYc);
          });
        });
      }
      if (key === "2") {
        // 急速pc
        axios({
          method: "post",
          url: "getInfo/Latest",
          data: {
            type: "jspc",
          },
        }).then((res) => {
          this.qishu = res.data.section;
          var openNums = res.data.openNums;
          let as = openNums.split(",");
          this.nowFirstNum = as[0];
          this.nowSecondNum = as[1];
          this.nowThreeNum = as[2];
          this.nowTotalNum =
            parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
          if (this.nowTotalNum > 13) {
            this.nowIsBigOrSamll = "大";
          } else {
            this.nowIsBigOrSamll = "小";
          }
          if (this.nowTotalNum % 2 == 0) {
            this.nowIsdanOrShuang = "双";
          } else {
            this.nowIsdanOrShuang = "单";
          }
        });
        axios({
          method: "post",
          url: "getInfo/MyOpens",
          data: {
            type: "jspc",
          },
        }).then((res) => {
          this.tableData = res.data.data.data;
          axios({
            method: "post",
            url: "getInfo/Next",
            data: {
              type: "jspc",
            },
          }).then((res) => {
            // 计算 开奖倒计时
            var timediff = res.data.openTime - res.data.serverTime;
            this.seconds = timediff / 1000;
            this.nextQishu = res.data.section;

            let nextYc = {
              section: this.nextQishu,
              isOpen: "",
              middleCode: "",
              openTime: "",
            };
            this.tableDataYc = JSON.parse(JSON.stringify(this.tableData));
            this.tableDataYc.unshift(nextYc);
          });
        });
      }
      this.say("jieguoid");
    },
    changeCount(value) {
      this.tabvalue == value;
    },
    formartResult(row, column) {
      var openNums = row.middleCode;
      if (openNums === "") {
        return "";
      }
      let as = openNums.split(",");
      let total = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      let resultStr = as[0] + "+" + as[1] + "+" + as[2] + "=" + total;
      return resultStr;
    },
    formartResultYc(row, column) {
      var section = row.section;
      var num = parseInt(section);
      if (num % 3 == 0) {
        return "大+单";
      }
      if (num % 3 == 1) {
        return "小+单";
      }
      if (num % 3 == 2) {
        return "大+双";
      }
      if (num % 3 == 3) {
        return "小+双";
      }
    },
    formartResultNew(row, column) {
      var openNums = row.middleCode;
      let as = openNums.split(",");
      let total = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      return total;
    },
    formartResultBig(value) {
      var openNums = value;
      let as = openNums.split(",");
      let total = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      if (total > 13) {
        return true;
      } else {
        return false;
      }
    },
    formartResultDan(value) {
      var openNums = value;
      let as = openNums.split(",");
      let total = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      if (total % 2 != 0) {
        return true;
      } else {
        return false;
      }
    },
    formartResultduiorcuo(value1, value2) {
      let as = value2.split(",");
      let nowTotalNum = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      let nowIsBigOrSamll = false;
      let nowIsdanOrShuang = false;
      if (nowTotalNum > 13) {
        nowIsBigOrSamll = true;
      } else {
        nowIsBigOrSamll = false;
      }
      if (nowTotalNum % 2 == 0) {
        nowIsdanOrShuang = true;
      } else {
        nowIsdanOrShuang = false;
      }

      var num = parseInt(value1);
      var flag = false;
     
      if (num % 3 == 0) {
        if (nowIsBigOrSamll || nowIsdanOrShuang == false) {
          flag = true;
        }
      }
      if (num % 3 == 1) {
        if (nowIsBigOrSamll == false || nowIsdanOrShuang == false) {
          flag = true;
        }
      }
      if (num % 3 == 2) {
        if (nowIsBigOrSamll || nowIsdanOrShuang) {
          flag = true;
        }
      }
      if (num % 3 == 3) {
        if (nowIsBigOrSamll == false || nowIsdanOrShuang) {
          flag = true;
        }
      }
      return flag;
    },

    formartResultBigDan(value) {
      var openNums = value;
      let as = openNums.split(",");
      let total = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      if (total % 2 != 0) {
        if (total > 13) {
          return "dadan";
        } else {
          return "xiaodan";
        }
      } else {
        if (total > 13) {
          return "dashuang";
        } else {
          return "xiaoshaung";
        }
      }
    },

    formartDate(row, column) {
      if (row.openTime === undefined || row.openTime === "") {
        return "";
      }
      var time = new Date(row.openTime);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return (
        this.add0(m) +
        "-" +
        this.add0(d) +
        " " +
        this.add0(h) +
        ":" +
        this.add0(mm) 
      );
    },
    add0(m) {
      return m < 10 ? "0" + m : m;
    },
    countDown() {
      let m = parseInt(this.seconds / 60);
      let s = parseInt(this.seconds % 60);

      this.xyqfen = m;
      this.xyqmiao = s;
      if (this.seconds <= 0) {
        this.showResultdf = true;
        // 掉获取最新的数据的接口
        if (this.activeIndex2 === "1") {
          axios({
            method: "post",
            url: "getInfo/Open",
            data: {
              type: "jnd28",
              section: this.nextQishu,
            },
          }).then((res) => {
            if (res.data.section === undefined) {
            } else {
              this.qishu = res.data.section;
              var openNums = res.data.code;
              let as = openNums.split(",");
              this.nowFirstNum = as[0];
              this.nowSecondNum = as[1];
              this.nowThreeNum = as[2];
              this.nowTotalNum =
                parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
              if (this.nowTotalNum > 13) {
                this.nowIsBigOrSamll = "大";
              } else {
                this.nowIsBigOrSamll = "小";
              }
              if (this.nowTotalNum % 2 == 0) {
                this.nowIsdanOrShuang = "双";
              } else {
                this.nowIsdanOrShuang = "单";
              }
              // 查询list
              axios({
                method: "post",
                url: "getInfo/MyOpens",
                data: {
                  type: "jnd28",
                },
              }).then((res) => {
                this.tableData = res.data.data;
                // 查询next
                axios({
                  method: "post",
                  url: "getInfo/Next",
                  data: {
                    type: "jnd28",
                  },
                }).then((res) => {
                  // 计算 开奖倒计时
                  var timediff = res.data.openTime - res.data.serverTime;
                  this.seconds = timediff / 1000;
                  this.nextQishu = res.data.section;
                  let nextYc = {
                    section: this.nextQishu,
                    isOpen: "",
                    middleCode: "",
                    openTime: "",
                  };
                  this.tableDataYc = JSON.parse(JSON.stringify(this.tableData));
                  this.tableDataYc.unshift(nextYc);
                });
              });
            }
          });
        }
        // if (this.activeIndex2 === "2") {
        //   axios({
        //     method: "post",
        //     url: "getInfo/Open",
        //     data: {
        //       type: "jspc",
        //       section: this.nextQishu,
        //     },
        //   }).then((res) => {
        //     if (res.data.section === undefined) {
        //     } else {
        //       this.qishu = res.data.section;
        //       var openNums = res.data.code;
        //       let as = openNums.split(",");
        //       this.nowFirstNum = as[0];
        //       this.nowSecondNum = as[1];
        //       this.nowThreeNum = as[2];
        //       this.nowTotalNum =
        //         parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
        //       if (this.nowTotalNum > 13) {
        //         this.nowIsBigOrSamll = "大";
        //       } else {
        //         this.nowIsBigOrSamll = "小";
        //       }
        //       if (this.nowTotalNum % 2 == 0) {
        //         this.nowIsdanOrShuang = "双";
        //       } else {
        //         this.nowIsdanOrShuang = "单";
        //       }
        //       // 查询list
        //       axios({
        //         method: "post",
        //         url: "getInfo/MyOpens",
        //         data: {
        //           type: "jspc",
        //         },
        //       }).then((res) => {
        //         this.tableData = res.data.data.data;
        //         // 查询next
        //         axios({
        //           method: "post",
        //           url: "getInfo/Next",
        //           data: {
        //             type: "jspc",
        //           },
        //         }).then((res) => {
        //           // 计算 开奖倒计时
        //           var timediff = res.data.openTime - res.data.serverTime;
        //           this.seconds = timediff / 1000;
        //           this.nextQishu = res.data.section;

        //           let nextYc = {
        //             section: this.nextQishu,
        //             isOpen: "",
        //             middleCode: "",
        //             openTime: "",
        //           };
        //           this.tableDataYc = JSON.parse(JSON.stringify(this.tableData));
        //           this.tableDataYc.unshift(nextYc);
        //         });
        //       });
        //     }
        //   });
        // }
      } else {
        this.showResultdf = false;
      }
    },
    Time() {
      setInterval(() => {
        this.seconds -= 1;
        this.countDown();
      }, 1000);
    },
  },
  created() {},
  mounted() {
    this.tabValue = "jieguo";
    this.activeIndex2 = "1";
    axios({
      method: "post",
      url: "getInfo/Latest",
      data: {
        type: "jnd28",
      },
    }).then((res) => {
      this.qishu = res.data.section;
      var openNums = res.data.openNums;
      let as = openNums.split(",");
      this.nowFirstNum = as[0];
      this.nowSecondNum = as[1];
      this.nowThreeNum = as[2];
      this.nowTotalNum = parseInt(as[0]) + parseInt(as[1]) + parseInt(as[2]);
      if (this.nowTotalNum > 13) {
        this.nowIsBigOrSamll = "大";
      } else {
        this.nowIsBigOrSamll = "小";
      }
      if (this.nowTotalNum % 2 == 0) {
        this.nowIsdanOrShuang = "双";
      } else {
        this.nowIsdanOrShuang = "单";
      }
    });
    axios({
      method: "post",
      url: "getInfo/MyOpens",
      data: {
        type: "jnd28",
      },
    }).then((res) => {
      this.tableData = res.data.data;
      axios({
        method: "post",
        url: "getInfo/Next",
        data: {
          type: "jnd28",
        },
      }).then((res1) => {
        // 计算 开奖倒计时
        var timediff = res1.data.openTime - res1.data.serverTime;
        this.seconds = timediff / 1000;
        this.nextQishu = res1.data.section;

        let nextYc = {
          section: this.nextQishu,
          isOpen: "",
          middleCode: "",
          openTime: "",
        };
        this.tableDataYc = JSON.parse(JSON.stringify(this.tableData));
        this.tableDataYc.unshift(nextYc);
      });
    });
    this.Time();
  },
};
</script>
